#include "../../server/rpc_server.hpp"
    void Add(const Json::Value &req, Json::Value &rsp)
    {
        int num1=req["num1"].asInt();
        int num2=req["num2"].asInt();
        rsp=num1+num2;
        DLOG("返回值是%d",rsp.asInt());
    }
int main()
{
    //先使用方法描述工厂,将方法描述定义出来
    auto service_factory=std::make_shared<BRpc::Server::SDescribeFactory>();
    service_factory->setMethodName("Add");
    service_factory->setParamsDesc("num1",BRpc::Server::VType::INTEGRAL);
    service_factory->setParamsDesc("num2",BRpc::Server::VType::INTEGRAL);
    service_factory->setReturnType(BRpc::Server::VType::INTEGRAL);
    service_factory->setCallback(Add);
    auto service=service_factory->build();

    BRpc::Address host("127.0.0.1",8080);
    BRpc::Server::RpcServer server(host);
    server.registerMethod(service);
    server.start();
    sleep(5);
    return 0;
}